package com.aibaixun;

import com.aibaixun.system.domain.PostureDevice;
import com.aibaixun.system.domain.dto.IndexStatisticsDto;
import com.aibaixun.system.service.EvsApiService;
import com.aibaixun.system.service.IndexStatisticsService;
import com.aibaixun.system.service.PostureDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.time.LocalDateTime;
import java.util.LinkedList;
import java.util.List;

/**
 * 启动程序
 *
 * @author zhangyh
 */
@EnableAsync
@EnableScheduling
@SpringBootApplication
public class GuianStorageApplication {

    @Autowired
    private IndexStatisticsService indexStatisticsService;

    @Autowired
    private PostureDeviceService postureDeviceService;

    @Autowired
    private EvsApiService evsApiService;

    public static void main(String[] args) {
        System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication application = new SpringApplication(GuianStorageApplication.class);
        application.setApplicationStartup(new BufferingApplicationStartup(2048));
        application.run(args);
        System.out.println("(♥◠‿◠)ﾉﾞ  启动成功   ლ(´ڡ`ლ)ﾞ");
    }

    @Bean
    CommandLineRunner testTaskStart(){
        return args -> {
            System.out.println("接口测试开始==========================");
//            evsApiService.deleteThirdWorkerOrderUser();
//            evsApiService.updateAiApp();

            System.out.println("接口测试结束==========================");
        };
    }

}
